<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <div id="app">
        <item-vue></item-vue>
    </div>
    <script>
        let Itemvue=Vue.extend({
            template:
                `<div style="border:1px solid red">
                    <h1>自定义组件标签-{{ msg }}</h1>
                    <input type="text" v-model="msg">
                    <input type="button" value="提示msg" @click="showMsg()">
                </div>
            `,
            data(){
                return {
                    msg:"组件数据",
                }
            },
            methods: {
                showMsg(){
                    alert(this.msg)
                }
            },
            beforeCreate() {
                console.log(this.$el);
                console.log(this);
            },
            mounted() {
                console.log(this.$el)
            },
            
        })
        Vue.component("ItemVue", Itemvue)
        new Vue({
            el:"#app",
            data:{
                 msg:"haha"   
            },
            methods: {
                
            },
        })

    </script>
</body>
</html>